<template>
  <div>
    <div class="right">
      <a href="javascript:void (0)" v-routers="{path:'/'}"></a>
    </div>
    <div class="card">
      <el-input style="width: 260px;margin-right: 10px" placeholder="请输入教室"></el-input>
      <el-button class="defaultBtn" icon="el-icon-search" color="#333" type="info">查询</el-button>
      <el-button class="defaultBtn" icon="el-icon-refresh-right"  type="info">重置</el-button>
    </div>
    <div class="card">
      <el-button class="defaultBtn" icon="el-icon-plus" @click="dialogVisible=true" type="info">新增</el-button>
    </div>

    <el-table :data="tableData" border style="width: 100%">
      <el-table-column prop="name" label="教室名称" min-width="180"></el-table-column>
      <el-table-column prop="class" label="教室容量" min-width="180"></el-table-column>
<!--      <el-table-column prop="major" label="课程名称" min-width="180"></el-table-column>-->
      <el-table-column prop="type" label="教室状态" min-width="180">
        <template #default="{row}">{{type(row)}}</template>
      </el-table-column>
      <el-table-column prop="crateTime" label="创建时间" min-width="180"></el-table-column>
      <el-table-column fixed="right" align="center" label="操作" width="220">
        <el-button size="mini" class="defaultBtn" type="info">查看</el-button>
        <el-button size="mini" class="defaultBtn" type="info">删除</el-button>
        <el-button size="mini" class="defaultBtn" type="info">编辑</el-button>
      </el-table-column>
    </el-table>
    <div class="page">
<!--      <el-pagination background layout="prev, pager, next" :total="1000"></el-pagination>-->
    </div>


    <el-dialog title="教室座位" :visible.sync="dialogVisible" width="1200px" :before-close="handleClose">
      <st-map></st-map>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="info" class="defaultBtn" @click="dialogVisible = false">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      dialogVisible:false,
      tableData: [{name:'逸夫楼3楼608',class:'101',major:'计算机科学与网络',type:0,crateTime:'2022-12-31 12:00:00'}]
    }
  },
  methods:{
    type(item){
      console.log(item)
      switch (item.type){
        case 0:{
          return '使用中'
        }
        case 1:{
          return  '空闲中'
        }
      }
    },
    handleClose(){
      this.dialogVisible=false
    }
  },
  mounted() {

  }
}
</script>

<style scoped lang="scss">

.card{
  width: 100%;
  margin: 10px 0;
}
.page{
  width: 100%;
  display: flex;
  justify-content: right;
  margin-top: 10px;
}
::v-deep(.el-pagination.is-background .el-pager li:not(.disabled).active ){
  background: #333 !important;
  color: #fff;
}
</style>
